Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a measure named Quantity which has the following expression
if([Table Source]=('WHUIL200'),Sum({<[Invoice_Date_GMT_Updated] = {"$(vLastmonthdate)"}>} Quantity)
,if([Table Source]=('TIUIL962'),Sum({<[As_On_Date_GMT_Updated] = {"$(vLastmonthdate)"}>} Quantity)
,if([Table Source]=('FG GIT'),Sum(Quantity)
,if([Table Source]=('WHINH301') and ("T$LTRL"=1) and ((len(trim("T$BOLA"))>0)),Sum({<[Ship_Date_GMT_Updated]={"<=$(vLastmonthdate)"},[Arrive_Date_GMT_Updated]={">$(vLastmonthdate)"}>} Quantity)
,if([Table Source]=('WHINH301') and ("T$LTRL"=2) and ((len(trim("T$BOLA"))>0)),Sum({<[Ship_Date_GMT_Updated]={"<=$(vLastmonthdate)"}>} Quantity))))))
I want to put all the if conditions inside the set analysis so that my value of quantity does not get hampered.
Please help.
You can union sets, maybe that is what you are looking for:
sum({
<[Table Source]={'WHUIL200'},[Invoice_Date_GMT_Updated] = {"$(vLastmonthdate)"}>
+
<[Table Source]={'TIUIL962'},[As_On_Date_GMT_Updated] = {"$(vLastmonthdate)"}>
+
<[Table Source]={'FG GIT'}>
+
<... finish your sets ...>
} Quantity)
You cannot put conditional calculations based on your dimension value in set analysis, that is not what set analysis is for
I would suggest you simplify your data model
Go thru the below
https://community.qlik.com/t5/Qlik-Design-Blog/Canonical-Date/ba-p/1463578
you can use Pick & Match to 'somewhat' simplify this
You can union sets, maybe that is what you are looking for:
sum({
<[Table Source]={'WHUIL200'},[Invoice_Date_GMT_Updated] = {"$(vLastmonthdate)"}>
+
<[Table Source]={'TIUIL962'},[As_On_Date_GMT_Updated] = {"$(vLastmonthdate)"}>
+
<[Table Source]={'FG GIT'}>
+
<... finish your sets ...>
} Quantity)
I did this
Sum({<[Table Source]={'WHINH301'},[Flag]={'0'},[T$LTRL]={'1'},[Ship_Date_GMT_Updated]={"<=$(vLastmonthdate)"},[Arrive_Date_GMT_Updated]={">$(vLastmonthdate)"}>} Quantity)
+
Sum({<[Table Source]={'WHINH301'},[Flag]={'0'},[T$LTRL]={'2'},[Ship_Date_GMT_Updated]={"<=$(vLastmonthdate)"}>} Quantity)
+
Sum({<[Table Source]={'WHUIL200'},[Invoice_Date_GMT_Updated]={"$(vLastmonthdate)"}>} Quantity)
+
Sum({<[Table Source]={'TIUIL962'},[As_On_Date_GMT_Updated]={"$(vLastmonthdate)"}>} Quantity)
+
Sum({<[Table Source]={'FG GIT'}>} Quantity)
the total value is also coming correct but when I am filtering my table by clicking any record my quantity remains same, but it should change as per the filter.
Plzz help.