Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Learn how to migrate to Qlik Cloud Analytics™: On-Demand Briefing!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

max in condition

hi

i have table like this:

OrderSpecificationDim_KeyTypeCheekDim_KeyadSanadId
13910023172026886
1391002317329402
13910023182026888
13910023192026890
13910023192329611
1391002320351628
13910023202329609
13910023202026892

i need too show TypeCheekDim_Key for any OrderSpecificationDim_Key forthe max value of adSanadId

for example when OrderSpecificationDim_Key=1391002320 i should show 3 because it has the biggest value of adSanadId. i have wrote :

if ( (Aggr(max([Ad Sanad Id]),[Id Order])=[Ad Sanad Id]),[Type Check Dim Key],0 )

but it is not true it seem. any one can help me?

31 Replies
antoniotiman
Master III
Master III

Mana,

aggr() is Dimention and Sum() is expression

Not applicable
Author

i have uploaded the output of query i made on my fact table in sql server and the qlikview for the same order ids.

as you see in pictures qlikview shows the sum not the max.

anbu1984
Master III
Master III

It seems like you have not loaded data properly. I don't see 46 for TypeCheekDim_Key in sql queryscreenshot

EDIT: Table mentioned in qlikview script is [Darya Warehouse MSH 4]. There is different table used in sql query screenshot

Not applicable
Author

i have uploaded the output of query i made on my fact table in sql server and the qlikview for the same order ids.

as you see in pictures qlikview shows the sum not the max.

antoniotiman
Master III
Master III

Your only dimension is Aggr(if())
in Pivot Table and expression sum()

Not applicable
Author

[Darya Warehouse MSH 4] is one of the cubes which is created on  Darya Warehouse MSH.

so thre is no mistake in data load

anbu1984
Master III
Master III

As you can see below, table box shows only one row for selected Id Order. Data loaded in qlikview has summed value 46. Problem is in your Sql or source table

630659.png

anbu1984
Master III
Master III

Your cube has summed values

Not applicable
Author

it didnt change

antoniotiman
Master III
Master III

In Aggr(If(TOTAL

after TOTAL add <IdOrder>