Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
sanjujeeboy
Creator
Creator

Load max date and hour

Hi All,

I have a table like this

CountryDate HourSales
germany11/7/20191100
germany11/7/20192101
germany11/7/20193102
germany11/7/20194103
Italy11/7/20191103
Italy11/7/20192104
Italy11/8/20193105
Spain11/7/20191106
Spain11/7/20192107
Spain11/8/20193108

Requirement is i want to get max date max hour sales for each country. So the output should be:

CountryDate HourSales
germany11/7/20194103
Italy11/8/20193105
Spain11/8/20193108
    

How to write a set expression for this?

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Hi Sanjujeeboy,

I can get the desired output with the solution provided here in your other post here: https://community.qlik.com/t5/New-to-QlikView/Load-max-hour/m-p/1643796#M383043

Capture.PNG

Are you still looking for Set Analysis solution, or something is missing ? If you continue with one thread, it would be better for others and you as well - to reach the solution you need.

View solution in original post

7 Replies
waszcma1
Partner - Creator II
Partner - Creator II

in script mode write this:


Load 
Country,

max(Date) as Date,

max(hour) as hour,

max(Sales) as Sales

from your_source_file.qvd(qvd) group by Country;

Arthur_Fong
Partner - Specialist III
Partner - Specialist III

If you want to create in expression, try this:

Hour > aggr(max(Hour),Country)

Sales > aggr(max(Sales),Country)

sanjujeeboy
Creator
Creator
Author

i have loaded in script mode.

how to write expressions in table to achieve output?

tresesco
MVP
MVP

Hi Sanjujeeboy,

I can get the desired output with the solution provided here in your other post here: https://community.qlik.com/t5/New-to-QlikView/Load-max-hour/m-p/1643796#M383043

Capture.PNG

Are you still looking for Set Analysis solution, or something is missing ? If you continue with one thread, it would be better for others and you as well - to reach the solution you need.

sanjujeeboy
Creator
Creator
Author

Hi Tresesco

I have put the same expression but its not working in qliksense.

although this expression works in qlikview but not working in qliksense.

can you try in qliksense and let me know.

Thanks in advance.

tresesco
MVP
MVP

It should also work in qlik sense. Try to share your sample qvf that is not working...and let me have a look at it and fix the issue for you.

sanjujeeboy
Creator
Creator
Author

Hi Tresesco,

Its working in qliksense also. there was some data model issues, thats why data was not showing. But now its fixed.

Thanks a lot for your help.