Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
gauthamchilled
Creator
Creator

Firstsortedvalue not working

i would like to show startdate of sales for each country ..my date format is like below

fy2015,20152

my2015,20151

fy2014,20142

my2014,20141

just want to show start date as first sales date or first business started year.

can you help please?

11 Replies
MayilVahanan

Hi

Try like this

country Start Date
ChileFY2014
ChinaMY2014
SwitzerlandFY2013
UKMY2013
USFY2013

=FirstSortedValue(Period, PeriodActual)

Or

in back end

Test:

Load * inline

[

Period, PeriodActual,country,sales

FY2015,20152,Switzerland,23000

FY2013,20132,Switzerland,13000

MY2015,20151,China,121000

FY2014,20142,Chile,221211

MY2014,20141,China,21300

FY2013,20132,US,321310

FY2015,20152,US,321313

MY2013,20131,UK,311421

];

LOAD country, FirstSortedValue(Period, PeriodActual)  as StartDate Resident Test

Group by country;

country StartDate
ChileFY2014
ChinaMY2014
SwitzerlandFY2013
UKMY2013
USFY2013
Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
gauthamchilled
Creator
Creator
Author

Thanks mayil, but =FirstSortedValue(Period, PeriodActual) is not working , find the attachment and can you help to look please

raju_insights
Partner - Creator III
Partner - Creator III

Hi Gautham Prasad,

Your requirement is not clear. Can you show us required output ?

gauthamchilled
Creator
Creator
Author

output.JPG

output is already available in the thread

ramasaisaksoft

Hi Gautham,

1)As per your text object,you mentioned 2012 but there is no 2012 year

2)The data which you provide is not understandable for me

you want to show like

if business starts in  US at  2012 you want 2012 sales only even though you selected any year in Filter am i right?

like that

even though you select 2014 as year for country Switzerland (this country starts the business 2 times in 2013 and 2015 so which one we need to show in data?)

sorry i am unable to understand your question tha's way i am asking these many questions

i hope you will get start year data  for country wise ,you need to write set analysis/If conditions for each and every country.

gauthamchilled
Creator
Creator
Author

Mayils firstsortedvalue function is working but not working if i select any period from the filter..i think i need to show date irrespective of current selected year

MayilVahanan

Hi

try like this

=FirstSortedValue({<Period=>}Period, PeriodActual)

Or go for Back end process.

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
ramasaisaksoft

Hi Gautham,,

take a Staraight table objetct,

dim: Country

Expr :FirstSortedValue(Period,PeriodActual)

then you will get your solution

else

in code/script  level you can fallow mayilvahanan solution

gauthamchilled
Creator
Creator
Author

Thanks mayilvahanan

I did the same, but it show 0 values for all the countries sales even though they dont have sales. start date is working fine.

Is there any way to get rid of those zeros..attached the file