Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
renatoteixeira
Partner - Contributor
Partner - Contributor

Transfer 50% of the value from one side to the other

Hello friends, thanks for your time.

I'm having an problem.

Capturar.JPG

 

I need to move 50% of the value that every CC have( Column CC ORIGEM) to the corresponding one CR (Column CC DESTINO).  What's your advice?

 

Again, Thanks 

7 Replies
Nadi_Clarke
Contributor II
Contributor II

If I understand correctly then you should do

 

mid(CCORIGEM,1,5)& mid(CCDESTINO,6, len(CCDESTINO)-6)

or

replace(CCDESTINO,'230CR','224CC')

renatoteixeira
Partner - Contributor
Partner - Contributor
Author

Maybe my question isnt complete.

I have another table with the field CC  ( that Match with the both columns CCORIGEM and CCDESTINO) with the amount.

Imagine that example,

The 224CC9000 has the ammount of 500, what I need is that half of that amount (225) be transferred to 230CR2000 and so on. 

 Thanks by your time

 

Nadi_Clarke
Contributor II
Contributor II

Sorry, I still dont understand what you want.

Can you make me example.

 like column(1) + column(2) = result

Brett_Bleess
Former Employee
Former Employee

Did you get things sorted out, or are you still trying to find a solution?  If you did come up with something, please post that solution, so others on the community can learn from that.  You can write that up and then use the Accept as Solution button to mark it as what you did etc.  

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.
renatoteixeira
Partner - Contributor
Partner - Contributor
Author

I'm still struggling to find an way to do this. 

Basically, i have the principal table that have all the information and i want to cross that main table with that little table with the CC_origem and the CC_destino.

I can't figure out waht to do. 

Brett_Bleess
Former Employee
Former Employee

It will likely help if you can attach a sample app or a subset of what you have etc., as sometimes folks need to be able to see the data model and stuff in order to figure out what the right answer is...

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.
asinha1991
Creator III
Creator III

if I understand correct then you have a field lets say A which has 'n' values and you want to create a new table with B and C fields, and each of them will have n/2 randomly allocated values? I don't know why you want to do this but I can think of a way

Table1:

Load A,addfield,rowNo() as RNO from Table 1;

 

Table 2:

Load additionalfield, 

if (mod(RNO,2)=0,A) as B,

if(not mod(RNO,2)=0,A) as C,

Resident Table1;

Drop table Table1;

so I distributed A 50-50 in B and C