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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis for Yd's Data

Hi,

I have a straight table with dimensions Company, Date, Yd Date

Expressions : Cost , Yd Cost

I am having trouble displaying Yd Cost.

Company, Date, and Cost come from the same table but Yd Date comes from a different table and is joined by Date field. I tried set analysis:

sum({<[DATE]= {'$(=Date(max({<[YD DATE] = {"<$(=max([DATE]))"}> } [YD DATE])))'}>}  COST)

The idea was for it to pick the max YD DATE which is less than DATE but it doesn't work. I would like to see a list of dates but with using MAX it will only display one record.

Labels (1)
7 Replies
Not applicable
Author

try this

=sum({<[YD DATE]= p({$<max([YD DATE]) = {"<$(=max([DATE]))"}> } [YD DATE])>} COST)

or this

=sum({<[YD DATE]= p({$<max([YD DATE]) = {"<max([DATE])"}> } [YD DATE])>} COST)

Not applicable
Author

Gives syntax error and when that's changed, just zeros

CELAMBARASAN
Partner - Champion
Partner - Champion

Check with this

=sum({<[DATE]={"=[DATE]<[YD DATE]"}>} COST)

Not applicable
Author

Thanks.

If I change < to > like this:

=sum({<[DATE]={"=[DATE]>[YD DATE]"}>} COST)

Then costs are displayed but for [DATE], not [YD DATE]

Would it be possible to show costs for max YD DATE excluding DATE?

CELAMBARASAN
Partner - Champion
Partner - Champion

not clear. can you explain clearly if possible with some examples.

Not applicable
Author

COMPANY          DATE              COSTS           YD DATE           YD COSTS

ABC                    16/01/2013      2000              17/01/2013          1900

ABC                    17/01/2013      1800              16/01/2013          2000

This is what it should look like. I can't get YD COSTS. If I use

=sum({<[DATE]={"=[DATE]>[YD DATE]]"}>} COST)

Then I get this:

COMPANY          DATE              COSTS           YD DATE           YD COSTS

ABC                    16/01/2013      2000              17/01/2013          2000

ABC                    17/01/2013      1800              16/01/2013          1800

YD COSTS are not right

Not applicable
Author

I need to get YD COSTS for YD DATE.