Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

luisccmm
Contributor

Concatenate Year and Month whitin a Function

Hi,

I have a Variable call that has $1 related to the a Yearmonth variable.

The Followin formula is producing the expected result, so it´s OK.

$(vKPI_CLI_PED($(=text($(vAnyoPedIso)*100 +1))))

vKPI_CLI_PED: This is my variable, that has not problems at all.


The $(1) of the vKPI_CLI_PEDis then replaced for ($(=text($(vAnyoPedIso)*100 +1)))


vAnyoPedIso result is 2017 (year), That when is multiplied by 100 and plus 1 will endup being 201701 (201700+1)


I need now to produce something different for this Time formula.


Concatenate text($(vAnyoPedIso) with OnlyNumberMonth.


  • vOnlynumberMonth is a dimension has the following values for 12 months: 01, 02, 03, 04....12 


But I am not able to produce the right result with CONCATENATE, please any help??


I was trying something like:


$(vKPI_CLI_PED($(=Concat(text($(vAnyoPedIso),OnlyNumberMonth ))))


But is not working.



Tags (2)
5 Replies
drillnaut
Valued Contributor

Re: Concatenate Year and Month whitin a Function

Not sure exactly what you are trying to do, but wouldn't it be easier to perform some of these calculations in the data model, instead of fussing and fighting with Set Analysis?

MVP
MVP

Re: Concatenate Year and Month whitin a Function

Would you be able to share a sample to look at this?

mov
Esteemed Contributor III

Re: Concatenate Year and Month whitin a Function

It's hard to understand...  It looks like you're making things ten times more complex than necessary.

Assuming that the variable vAnyoPedIso contains Year, it could be

date(makedate($(vAnyoPedIso), OnlyNumberMonth) , 'YYYY-MMM')

luisccmm
Contributor

Re: Concatenate Year and Month whitin a Function

I may have explained mysfelf badly. I need a set analysis solution for that, not a script solution.

I need to procude a graph like the following one below. With 2 variables:

- Nº Clients:  Variable name is vKPI_CLI_PED. This variable needs a date in the following format to operate  201701, 201702, 201703....

- Month Number: variable name is OnlyNumberMonth.  (01,02,03,04.....12)

I Ejemplo.png

So I need to concatenate Year and OnlyNumberMonth.


  • vAnyoPedIso is just the year: 2017


That´s why I was trying to produce something like


$(vKPI_CLI_PED($(=Concat(text($(vAnyoPedIso),OnlyNumberMonth ))))

I hope this is more clear

Regards

sadasiva
Contributor

Re: Concatenate Year and Month whitin a Function

Hi,

Maybe like this

"vAnyoPedIso"&"OnlyNumberMonth"

Regards,

Sadasiva