Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Good morning everyone. Sort of confused on this one. The "if" statement works, but the set analysis does not. Does anyone see anything that would make it not work? Would love to use set analysis
Thanks
sum(if([Profit Center] = [Hist Profit Center] and YTDFlag = '1',LID)) (WORKS)
sum({<[Profit Center] = {“$(=trim([Hist Profit Center]))”},FISPD=,YTDFlag = {'1'}>} [LID]) (DON'T WORK)
sum({<[Profit Center] = {[Hist Profit Center]},FISPD=,YTDFlag = {1}>} [LID]) (DON'T WORK)
Hi,
Try like this
=sum({<[Profit Center] = [Hist Profit Center],FISPD=,YTDFlag = {'1'}>} [LID])
Hope this helps you.
Regards,
Jagan.
Set analysis doesn't work if you compare a field value with another field value, the right expression must be a value (a number, string or variable) or at least an aggregation of a field
Thanks....but that does not work either.
Thom
Hi,
Try this
=sum({<[Profit Center] ={$(=Concat(DISTINCT [Hist Profit Center], ','))},FISPD=,YTDFlag = {'1'}>} [LID])
http://community.qlik.com/docs/DOC-4021
Hope this works.
Regards,
Jagan.
Not yet Jagan....
Try this.
sum({<[Profit Center] = {“=[Hist Profit Center] = [Profit Center]”},FISPD=,YTDFlag = {'1'}>} [LID])
Else upload your qvw file.
Regards,
Kaushik Solanki
Alexandros is right, set analysis will only get evaluated once, before the object is calculated. It's not possible to obtain different values for different rows.
This will work if there is a single possible value for Hist Profit Center
sum({<[Profit Center] = {'$(=only([Hist Profit Center]))'},FISPD=,YTDFlag = {1}>} [LID])
Else, you need to do something like this
sum({<FISPD=,YTDFlag = {1}>} if([Profit Center] = [Hist Profit Center],[LID]))
Sorry Kaushik....but Nope.
Do you want to "copy" selections from one field to another, or sum only those records which have value of [Profit Center] equal to [Hist Profit Center] (which is what the If does)? The latter is undoable with set analysis, as far as I know.
(You are not comparing values, but defining selection for [Profit Center], so if one value in [Profit Center] exists both with same [Hist Profit Center] and with a different [Hist Profit Center], there is no way to define a selection on [Profit Center] that would filter out only the values you want).