Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
How can i compare values in 2 fields in a set analysis.
Something like below but i am not able to get the syntax correctly.
Sum ({<SnapshotQuarter = {<$(=CurrentQuarter)}>}Sales)
All I want is Sum of Sales for all the SnapshotQtr which are previous to CurrentQtr. And i am specifically looking for a set analysis syntax.
Thanks in advance.
If SnapshotQuarter and CurrentQuarter both are numeric fields, the following might work:
Sum ({$<SnapshotQuarter = {"=SnapshotQuarter<Min(CurrentQuarter)"}>} Sales )
HIC
Is CurrentQuarter really a field? It seems more natural that it is a variable. But then again I dont know much about the context for this expression.
This might work
Sum ({<SnapshotQuarter = {"<$(CurrentQuarter)"}>}Sales)
The double quotes denotes a search.
I presume that both SnapshotQuarter and CurrentQuarter also contains the year they belong to so the search will be including the right quarters.
They could be like 2018Q1 and 2017Q4
or 201801 and 201704...
If SnapshotQuarter and CurrentQuarter both are numeric fields, the following might work:
Sum ({$<SnapshotQuarter = {"=SnapshotQuarter<Min(CurrentQuarter)"}>} Sales )
HIC
Yes the 2 fields are numeric. I assigned unique numbers in sending order to each quarter. This worked but I removed Min. Did not need that.
Sum ({$<SnapshotQuarter = {"=SnapshotQuarter<Min(CurrentQuarter)"}>} Sales )
Thank you hic
I used this:
Sum ({$<SnapshotQuarter = {"=SnapshotQuarter<(CurrentQuarter)"}>} Sales )